{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-01-08T02:52:50.651680Z",
     "start_time": "2019-01-08T02:52:50.637225Z"
    },
    "init_cell": true
   },
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt\n",
    "import tensorflow as tf\n",
    "%matplotlib inline\n",
    "\n",
    "import sys\n",
    "sys.path.append(\"..\")\n",
    "from models import lstm,cnn"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 数据统计"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-01-08T02:52:50.848466Z",
     "start_time": "2019-01-08T02:52:50.657752Z"
    },
    "init_cell": true
   },
   "outputs": [],
   "source": [
    "import preprocess\n",
    "from imp import reload\n",
    "reload(preprocess)\n",
    "\n",
    "# base_path = r\"F:\\mystyle\\git\\Sentiment-Analysis\\data\\ChnSentiCorp_htl_ba_2000\"\n",
    "base_path = r\"../data/ChnSentiCorp_htl_ba_2000/\"\n",
    "data, label = preprocess.read_data(base_path)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-01-08T02:52:50.919593Z",
     "start_time": "2019-01-08T02:52:50.850044Z"
    },
    "init_cell": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Data Count : 2000 ,Label Count : 2000\n",
      "Neg Count : 1000\n",
      "Pos Count : 1000\n"
     ]
    }
   ],
   "source": [
    "print(\"Data Count : {0} ,Label Count : {1}\".format(len(data),len(label)))\n",
    "emotion = dict()\n",
    "for v in label:\n",
    "    emotion.setdefault(\"neg\", 0)\n",
    "    emotion.setdefault(\"pos\", 0)\n",
    "    emotion[v] += 1\n",
    "    \n",
    "    \n",
    "print(\"Neg Count : {}\".format(emotion[\"neg\"]))\n",
    "print(\"Pos Count : {}\".format(emotion[\"pos\"]))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 数据预处理"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 替换\\n\\t"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-01-08T02:52:51.026306Z",
     "start_time": "2019-01-08T02:52:50.926296Z"
    },
    "init_cell": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'一开始本来要预定凯悦的，后来助理搞错了，订了个君悦。\\r\\r\\n简单评价以下。\\r\\r\\n柜台服务态度还可以，就是房间特小。\\r\\r\\n最不满意的就是宾馆的车队。\\r\\r\\n一开始我预约了一台丰田皇冠，后来我要用车的时候，柜台告诉我皇冠车出去了，只有花冠，然后告诉我价格是450元，我只好订下了。过一会儿花冠车司机过来了，就说价格是550元，立马抬高价格，我觉得这不是钱的问题，而是宾馆的信用问题。\\r\\r\\n中午时间，我要去吃饭，叫司机12：30过来接我，结果等到12：30，他没有出现。只能给君悦打电话了。\\r\\r\\n最不可忍受的就是那个司机一直边打电话边开车，那天我用车用了5个多小时，其中3个小时以上，司机都是在打电话。\\r\\r\\n如果入住君悦要用车的话，千万不要用君悦的车。素质极差。\\r\\r\\n\\r\\n\\r\\n'"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-01-08T02:52:51.155941Z",
     "start_time": "2019-01-08T02:52:51.031174Z"
    },
    "init_cell": true
   },
   "outputs": [],
   "source": [
    "for i,doc in enumerate(data):\n",
    "    doc = doc.replace(\"\\n\",\" \")\n",
    "    doc = doc.replace(\"\\t\",\" \")\n",
    "    doc = doc.replace(\"\\r\",\" \")\n",
    "    data[i] = doc"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-01-08T02:52:51.451545Z",
     "start_time": "2019-01-08T02:52:51.157255Z"
    },
    "init_cell": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'一开始本来要预定凯悦的，后来助理搞错了，订了个君悦。   简单评价以下。   柜台服务态度还可以，就是房间特小。   最不满意的就是宾馆的车队。   一开始我预约了一台丰田皇冠，后来我要用车的时候，柜台告诉我皇冠车出去了，只有花冠，然后告诉我价格是450元，我只好订下了。过一会儿花冠车司机过来了，就说价格是550元，立马抬高价格，我觉得这不是钱的问题，而是宾馆的信用问题。   中午时间，我要去吃饭，叫司机12：30过来接我，结果等到12：30，他没有出现。只能给君悦打电话了。   最不可忍受的就是那个司机一直边打电话边开车，那天我用车用了5个多小时，其中3个小时以上，司机都是在打电话。   如果入住君悦要用车的话，千万不要用君悦的车。素质极差。       '"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data[0]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 去掉标点符号"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-01-08T02:52:51.616082Z",
     "start_time": "2019-01-08T02:52:51.456859Z"
    },
    "init_cell": true
   },
   "outputs": [],
   "source": [
    "import re\n",
    "from zhon.hanzi import punctuation as ch_p\n",
    "from string import punctuation as en_p\n",
    "\n",
    "for i,doc in enumerate(data):\n",
    "    doc = re.sub(r\"[{0}{1}]+\".format(ch_p, en_p),\" \", doc)\n",
    "    doc = doc.strip()\n",
    "    data[i] = doc"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-01-08T02:52:51.717824Z",
     "start_time": "2019-01-08T02:52:51.618023Z"
    },
    "init_cell": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'一开始本来要预定凯悦的 后来助理搞错了 订了个君悦    简单评价以下    柜台服务态度还可以 就是房间特小    最不满意的就是宾馆的车队    一开始我预约了一台丰田皇冠 后来我要用车的时候 柜台告诉我皇冠车出去了 只有花冠 然后告诉我价格是450元 我只好订下了 过一会儿花冠车司机过来了 就说价格是550元 立马抬高价格 我觉得这不是钱的问题 而是宾馆的信用问题    中午时间 我要去吃饭 叫司机12 30过来接我 结果等到12 30 他没有出现 只能给君悦打电话了    最不可忍受的就是那个司机一直边打电话边开车 那天我用车用了5个多小时 其中3个小时以上 司机都是在打电话    如果入住君悦要用车的话 千万不要用君悦的车 素质极差'"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data[0]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 分词"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-01-08T02:52:52.755491Z",
     "start_time": "2019-01-08T02:52:51.728143Z"
    },
    "init_cell": true
   },
   "outputs": [],
   "source": [
    "import jieba\n",
    "\n",
    "for i,doc in enumerate(data):\n",
    "    cut_doc = jieba.cut(doc)\n",
    "    cut_doc = \" \".join(cut_doc)\n",
    "    data[i] = cut_doc\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-01-08T02:52:52.761963Z",
     "start_time": "2019-01-08T02:52:52.757583Z"
    },
    "init_cell": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'一 开始 本来 要 预定 凯悦 的   后来 助理 搞错 了   订 了 个 君悦         简单 评价 以下         柜台 服务态度 还 可以   就是 房间 特小         最 不 满意 的 就是 宾馆 的 车队         一 开始 我 预约 了 一台 丰田 皇冠   后来 我要 用车 的 时候   柜台 告诉 我 皇冠 车 出去 了   只有 花冠   然后 告诉 我 价格 是 450 元   我 只好 订下 了   过 一会儿 花冠 车 司机 过来 了   就 说 价格 是 550 元   立马 抬高 价格   我 觉得 这 不是 钱 的 问题   而是 宾馆 的 信用 问题         中午 时间   我要 去 吃饭   叫 司机 12   30 过来 接 我   结果 等到 12   30   他 没有 出现   只能 给 君悦 打电话 了         最 不可 忍受 的 就是 那个 司机 一直 边 打电话 边 开车   那天 我 用车 用 了 5 个 多 小时   其中 3 个 小时 以上   司机 都 是 在 打电话         如果 入住 君悦 要 用车 的话   千万 不要 用君悦 的 车   素质 极差'"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data[0]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 去掉停用词"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-01-08T02:53:35.882864Z",
     "start_time": "2019-01-08T02:53:35.857632Z"
    },
    "init_cell": true
   },
   "outputs": [],
   "source": [
    "# filename = r\"F:\\mystyle\\git\\Sentiment-Analysis\\data\\stopWord.txt\"\n",
    "filename = r\"../data/stopWord.txt\"\n",
    "stop_words = list()\n",
    "with open(filename,\"r\",encoding=\"utf-8\") as f:\n",
    "    for line in f:\n",
    "        line = line.replace(\"\\n\", \"\")\n",
    "        stop_words.append(line)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-01-08T02:53:39.979274Z",
     "start_time": "2019-01-08T02:53:38.422987Z"
    },
    "init_cell": true
   },
   "outputs": [],
   "source": [
    "for i,doc in enumerate(data):\n",
    "    words = doc.split(\" \")\n",
    "    temp = []\n",
    "    for word in words:\n",
    "        if word in stop_words:\n",
    "            continue\n",
    "        temp.append(word)\n",
    "    data[i] = \" \".join(temp)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-01-08T02:53:46.216659Z",
     "start_time": "2019-01-08T02:53:46.213665Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'本来 预定 凯悦 助理 搞错 订 君悦 简单 评价 以下 柜台 服务态度 房间 特小 最 满意 宾馆 车队 预约 一台 丰田 皇冠 我要 用车 柜台 告诉 皇冠 车 花冠 告诉 价格 450 元 只好 订下 一会儿 花冠 车 司机 过来 说 价格 550 元 抬高 价格 觉得 钱 问题 宾馆 信用 问题 中午 时间 我要 吃饭 司机 12 30 过来 接 12 30 出现 只能 君悦 打电话 最 不可 忍受 司机 一直 打电话 开车 那天 用车 小时 小时 以上 司机 打电话 入住 君悦 用车 用君悦 车 素质 极差'"
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-01-08T03:11:39.268687Z",
     "start_time": "2019-01-08T03:11:38.726255Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.image.AxesImage at 0x7f46adc6bcf8>"
      ]
     },
     "execution_count": 49,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAlYAAAE5CAYAAABS724NAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAIABJREFUeJzt3WdgHNW9NvBHVm8rWb1asmXZsuRewDYYFzAYSOjdlCQ3jXBDgvMGMCVAKIbkBhJySbk4oRkTejVg3DAG914kN9myJVmW1azepffDeGZ3dmd3Z3dnd2Z3n98X7ZzzP2eOXI/OnPmfkMHBQRARERGR54boPQAiIiKiQMGJFREREZFGOLEiIiIi0ggnVkREREQa4cSKiIiISCOcWBERERFphBMrIiIiIo1wYkVERESkEU6siIiIiDQSpvcAACAkJITp34mIiMgvDA4OhtirM8TEytqIJ54FAA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Mi34jNS0bE0GjpuqXsNAAgKiPBpry/u8/n4yMi8hT3WBERERFpxHArVjyEWV8Vx9eoejOw4vgaH4yGAk1CSSbqNx8HAMQVpCAy3SQrjytIAQBEppvQcbJRt3ESEbnLMBMrLc8KjE8f4XFfREb1wDOOT6c3soHefvQ0CqkKelPjbMoty4iI/BEfBRIRERFpxDArVloewhwP91esJsfYPgYTD1d2J87aJ69n2ZSJhzA7ilGKU9O3q/1rlW4hc9Klsq+WWk+Xux1rT0H4eBSEj1esaxqotYm1/Ooo1p6csZciZ6zygc0tZ8ptYi2/OopV49rb4l1uEwju+sr2PNHezj5sfGGn3RjrejXmDpMfrNw/2IuDjesd1gOQYuam/UC5vnWjuQ+FGMt6Szd+fqvsuq+zD9tf3OqwHoAshuxLDc3BpbF32q0/3VdhEw/ApTaOLLw9Bgtvj7Fb/9byTrdijXI/0aybM2VflXz77mlZvNpYT+/n6ticCRkcHFQd7C0hISGaDoLpFtw3d94S1RMrNXGkjT/9O13vIXjsNz+qRcb8MTi9qgwAED86Hf2dwqTDNDodp1eVIX608H32d/Zyj5UX+S7zurxOKfO6I97MvE7kicHBwRB7dQE5sSL3cWJF3pR3y1R0nWkFAERnJuDMhqMAgNSZI9B1phXRmcIxI2c2HOXEiogMy9HEinusiIiIiDTCFSuS4SHMREREjvFRIBEREZFG+CiQiIiIyAc4sSIiIiLSiCEeBRIREREFAq5YEREREWmEEysiIiIijXBiRURERKQRTqyIiIiINMKJFREREZFGOLEiIiIi0ggnVkREREQa4cSKiIiISCOcWBERERFphBMrIiIiIo1wYkVERESkEU6siIiIiDTCiRURERGRRjixIiIiItIIJ1ZEREREGuHEioiIiEgjnFgRERERaYQTKyIiIiKNcGJFREREpBFOrIiIiIg0wokVERERkUY4sSIiIiLSCCdWRERERBr5/4wDjYu6WQPeAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 720x432 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "from wordcloud import WordCloud\n",
    "\n",
    "wc = WordCloud(font_path=\"/usr/share/fonts/truetype/ubuntu/Ubuntu-LI.ttf\")\n",
    "text = \" \".join(data)\n",
    "img = wc.generate(text,)\n",
    "\n",
    "plt.figure(figsize=(10,6))\n",
    "plt.axis(\"off\")\n",
    "plt.imshow(img)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# TF-IDF + RF"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## TFIDF"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 89,
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "from sklearn.feature_extraction.text import TfidfVectorizer\n",
    "tfidf_v = TfidfVectorizer(lowercase=False, max_features = 200)\n",
    "tfidf_matrix = tfidf_v.fit_transform(data)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 分离训练集和验证集"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 101,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Train Count : 1757\n",
      "Test Count : 196\n"
     ]
    }
   ],
   "source": [
    "from sklearn.model_selection import train_test_split\n",
    "\n",
    "X_train, X_test, y_train, y_test = train_test_split(tfidf_matrix,label,test_size = 0.1)\n",
    "\n",
    "print(\"Train Count : {}\".format(X_train.shape[0]))\n",
    "print(\"Test Count : {}\".format(X_test.shape[0]))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## RF"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 114,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "RandomForestClassifier(bootstrap=True, class_weight=None, criterion='gini',\n",
       "            max_depth=None, max_features='sqrt', max_leaf_nodes=None,\n",
       "            min_impurity_decrease=0.0, min_impurity_split=None,\n",
       "            min_samples_leaf=1, min_samples_split=2,\n",
       "            min_weight_fraction_leaf=0.0, n_estimators=150, n_jobs=1,\n",
       "            oob_score=False, random_state=None, verbose=0,\n",
       "            warm_start=False)"
      ]
     },
     "execution_count": 114,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.ensemble import RandomForestClassifier\n",
    "\n",
    "n_estimators = 150\n",
    "max_features = \"sqrt\"\n",
    "\n",
    "rfc = RandomForestClassifier(n_estimators=n_estimators,max_features=max_features)\n",
    "rfc.fit(X_train,y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 115,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.8877551020408163"
      ]
     },
     "execution_count": 115,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.metrics import accuracy_score\n",
    "\n",
    "accuracy_score(y_true = rfc.predict(X_test),y_pred = y_test)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# LSTM"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 建立及转化词典"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [],
   "source": [
    "word2vocab = preprocess.create_vocab(data)\n",
    "\n",
    "temp = list()\n",
    "for sentence in data:\n",
    "    sent_index = list()\n",
    "    for word in sentence.split():\n",
    "        index = word2vocab[word]\n",
    "        sent_index.append(index)\n",
    "    temp.append(sent_index)\n",
    "        "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 获取最大长度的句子"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "394"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 获取最大长度的句子\n",
    "max_sentence = max(temp, key = lambda x: len(x))\n",
    "max_sentence_len = len(max_sentence)\n",
    "max_sentence_len"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 统一长度"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [],
   "source": [
    "sentence_len =  120\n",
    "\n",
    "for i,sentence_indexes in enumerate(temp):\n",
    "    sentence_indexes.extend([0] * sentence_len)\n",
    "    sentence_indexes = sentence_indexes[:sentence_len]\n",
    "\n",
    "    temp[i] = sentence_indexes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(1953, 120)"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data = np.asarray(temp)\n",
    "data.shape"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 建立模型"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "WARNING:tensorflow:From c:\\users\\administrator\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\tensorflow\\python\\keras\\_impl\\keras\\backend.py:1456: calling reduce_sum (from tensorflow.python.ops.math_ops) with keep_dims is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "keep_dims is deprecated, use keepdims instead\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "embedding_4 (Embedding)      (None, None, 200)         2381000   \n",
      "_________________________________________________________________\n",
      "lstm_1 (LSTM)                (None, 120)               154080    \n",
      "_________________________________________________________________\n",
      "dense_6 (Dense)              (None, 80)                9680      \n",
      "_________________________________________________________________\n",
      "dense_7 (Dense)              (None, 1)                 81        \n",
      "=================================================================\n",
      "Total params: 2,544,841\n",
      "Trainable params: 2,544,841\n",
      "Non-trainable params: 0\n",
      "_________________________________________________________________\n"
     ]
    }
   ],
   "source": [
    "from imp import reload\n",
    "reload(lstm)\n",
    "\n",
    "voc_size = len(word2vocab)\n",
    "lstm_model = lstm.create_lstm(voc_size)\n",
    "lstm_model.summary()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "outputs": [],
   "source": [
    "lstm_model.compile(optimizer=tf.train.AdamOptimizer(),loss=\"binary_crossentropy\",metrics=[\"accuracy\"])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 分离训练集验证集"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {},
   "outputs": [],
   "source": [
    "import sklearn\n",
    "from sklearn.model_selection import train_test_split\n",
    "\n",
    "# pos转化为1，neg为0\n",
    "temp_label = list()\n",
    "for sub_label in label:\n",
    "    v = 1 if sub_label == \"pos\" else 0\n",
    "    temp_label.append(v)\n",
    "label = temp_label\n",
    "    \n",
    "X_train, X_test, y_train, y_test = train_test_split(data,label,test_size = 0.1)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 训练"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Train on 1757 samples, validate on 196 samples\n",
      "Epoch 1/40\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 7s 4ms/step - loss: 0.4022 - acc: 0.7126 - val_loss: 0.0630 - val_acc: 1.0000\n",
      "\n",
      "Epoch 2/40\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 6s 4ms/step - loss: 0.0387 - acc: 1.0000 - val_loss: 0.0107 - val_acc: 1.0000\n",
      "\n",
      "Epoch 3/40\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 6s 4ms/step - loss: 0.0074 - acc: 1.0000 - val_loss: 0.0030 - val_acc: 1.0000\n",
      "\n",
      "Epoch 4/40\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 7s 4ms/step - loss: 0.0023 - acc: 1.0000 - val_loss: 0.0011 - val_acc: 1.0000\n",
      "\n",
      "Epoch 5/40\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 7s 4ms/step - loss: 8.9652e-04 - acc: 1.0000 - val_loss: 5.3177e-04 - val_acc: 1.0000\n",
      "\n",
      "Epoch 6/40\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 6s 4ms/step - loss: 4.4864e-04 - acc: 1.0000 - val_loss: 3.0717e-04 - val_acc: 1.0000\n",
      "\n",
      "Epoch 7/40\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 6s 4ms/step - loss: 2.7065e-04 - acc: 1.0000 - val_loss: 2.0491e-04 - val_acc: 1.0000\n",
      "\n",
      "Epoch 8/40\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 7s 4ms/step - loss: 1.8681e-04 - acc: 1.0000 - val_loss: 1.5275e-04 - val_acc: 1.0000\n",
      "\n",
      "Epoch 9/40\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 7s 4ms/step - loss: 1.4267e-04 - acc: 1.0000 - val_loss: 1.2293e-04 - val_acc: 1.0000\n",
      "\n",
      "Epoch 10/40\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 7s 4ms/step - loss: 1.1714e-04 - acc: 1.0000 - val_loss: 1.0529e-04 - val_acc: 1.0000\n",
      "\n",
      "Epoch 11/40\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 8s 5ms/step - loss: 1.0156e-04 - acc: 1.0000 - val_loss: 9.3551e-05 - val_acc: 1.0000\n",
      "\n",
      "Epoch 12/40\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 9s 5ms/step - loss: 9.1048e-05 - acc: 1.0000 - val_loss: 8.5490e-05 - val_acc: 1.0000\n",
      "\n",
      "Epoch 13/40\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 8s 4ms/step - loss: 8.3733e-05 - acc: 1.0000 - val_loss: 7.9591e-05 - val_acc: 1.0000\n",
      "\n",
      "Epoch 14/40\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 8s 4ms/step - loss: 7.8259e-05 - acc: 1.0000 - val_loss: 7.5000e-05 - val_acc: 1.0000\n",
      "\n",
      "Epoch 15/40\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 8s 5ms/step - loss: 7.3952e-05 - acc: 1.0000 - val_loss: 7.1261e-05 - val_acc: 1.0000\n",
      "\n",
      "Epoch 16/40\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 7s 4ms/step - loss: 7.0392e-05 - acc: 1.0000 - val_loss: 6.8078e-05 - val_acc: 1.0000\n",
      "\n",
      "Epoch 17/40\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 7s 4ms/step - loss: 6.7329e-05 - acc: 1.0000 - val_loss: 6.5273e-05 - val_acc: 1.0000\n",
      "\n",
      "Epoch 18/40\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 8s 4ms/step - loss: 6.4616e-05 - acc: 1.0000 - val_loss: 6.2761e-05 - val_acc: 1.0000\n",
      "\n",
      "Epoch 19/40\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 9s 5ms/step - loss: 6.2165e-05 - acc: 1.0000 - val_loss: 6.0451e-05 - val_acc: 1.0000\n",
      "\n",
      "Epoch 20/40\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 7s 4ms/step - loss: 5.9896e-05 - acc: 1.0000 - val_loss: 5.8278e-05 - val_acc: 1.0000\n",
      "\n",
      "Epoch 21/40\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 7s 4ms/step - loss: 5.7773e-05 - acc: 1.0000 - val_loss: 5.6273e-05 - val_acc: 1.0000\n",
      "\n",
      "Epoch 22/40\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 7s 4ms/step - loss: 5.5787e-05 - acc: 1.0000 - val_loss: 5.4351e-05 - val_acc: 1.0000\n",
      "\n",
      "Epoch 23/40\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 7s 4ms/step - loss: 5.3889e-05 - acc: 1.0000 - val_loss: 5.2515e-05 - val_acc: 1.0000\n",
      "\n",
      "Epoch 24/40\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 7s 4ms/step - loss: 5.2064e-05 - acc: 1.0000 - val_loss: 5.0731e-05 - val_acc: 1.0000\n",
      "\n",
      "Epoch 25/40\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 8s 4ms/step - loss: 5.0291e-05 - acc: 1.0000 - val_loss: 4.8992e-05 - val_acc: 1.0000\n",
      "\n",
      "Epoch 26/40\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 8s 5ms/step - loss: 4.8560e-05 - acc: 1.0000 - val_loss: 4.7294e-05 - val_acc: 1.0000\n",
      "\n",
      "Epoch 27/40\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 8s 5ms/step - loss: 4.6871e-05 - acc: 1.0000 - val_loss: 4.5637e-05 - val_acc: 1.0000\n",
      "\n",
      "Epoch 28/40\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 7s 4ms/step - loss: 4.5221e-05 - acc: 1.0000 - val_loss: 4.4019e-05 - val_acc: 1.0000\n",
      "\n",
      "Epoch 29/40\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 7s 4ms/step - loss: 4.3613e-05 - acc: 1.0000 - val_loss: 4.2440e-05 - val_acc: 1.0000\n",
      "\n",
      "Epoch 30/40\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 7s 4ms/step - loss: 4.2043e-05 - acc: 1.0000 - val_loss: 4.0901e-05 - val_acc: 1.0000\n",
      "\n",
      "Epoch 31/40\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 7s 4ms/step - loss: 4.0512e-05 - acc: 1.0000 - val_loss: 3.9406e-05 - val_acc: 1.0000\n",
      "\n",
      "Epoch 32/40\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 7s 4ms/step - loss: 3.9030e-05 - acc: 1.0000 - val_loss: 3.7960e-05 - val_acc: 1.0000\n",
      "\n",
      "Epoch 33/40\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 7s 4ms/step - loss: 3.7592e-05 - acc: 1.0000 - val_loss: 3.6552e-05 - val_acc: 1.0000\n",
      "\n",
      "Epoch 34/40\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 7s 4ms/step - loss: 3.6195e-05 - acc: 1.0000 - val_loss: 3.5186e-05 - val_acc: 1.0000\n",
      "\n",
      "Epoch 35/40\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 8s 5ms/step - loss: 3.4838e-05 - acc: 1.0000 - val_loss: 3.3860e-05 - val_acc: 1.0000\n",
      "\n",
      "Epoch 36/40\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 7s 4ms/step - loss: 3.3522e-05 - acc: 1.0000 - val_loss: 3.2575e-05 - val_acc: 1.0000\n",
      "\n",
      "Epoch 37/40\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 7s 4ms/step - loss: 3.2247e-05 - acc: 1.0000 - val_loss: 3.1331e-05 - val_acc: 1.0000\n",
      "\n",
      "Epoch 38/40\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 8s 5ms/step - loss: 3.1013e-05 - acc: 1.0000 - val_loss: 3.0130e-05 - val_acc: 1.0000\n",
      "\n",
      "Epoch 39/40\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 7s 4ms/step - loss: 2.9836e-05 - acc: 1.0000 - val_loss: 2.9014e-05 - val_acc: 1.0000\n",
      "\n",
      "Epoch 40/40\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 7s 4ms/step - loss: 2.8728e-05 - acc: 1.0000 - val_loss: 2.7935e-05 - val_acc: 1.0000\n",
      "\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<tensorflow.python.keras._impl.keras.callbacks.History at 0x1a4ae320>"
      ]
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lstm_model.fit(X_train,y_train,epochs=40,batch_size=512,validation_data=(X_test,y_test))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# CNN"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 建立词的映射"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [],
   "source": [
    "word2vocab = preprocess.create_vocab(data)\n",
    "\n",
    "temp = list()\n",
    "for sentence in data:\n",
    "    sent_index = list()\n",
    "    for word in sentence.split():\n",
    "        index = word2vocab[word]\n",
    "        sent_index.append(index)\n",
    "    temp.append(sent_index)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 规整长度"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [],
   "source": [
    "sentence_len =  120\n",
    "\n",
    "for i,sentence_indexes in enumerate(temp):\n",
    "    sentence_indexes.extend([0] * sentence_len)\n",
    "    sentence_indexes = sentence_indexes[:sentence_len]\n",
    "\n",
    "    temp[i] = sentence_indexes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(1953, 120)"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data = np.asarray(temp)\n",
    "data.shape"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 建立模型"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "embedding_10 (Embedding)     (None, None, 200)         2381000   \n",
      "_________________________________________________________________\n",
      "conv1d_9 (Conv1D)            (None, None, 4)           4004      \n",
      "_________________________________________________________________\n",
      "global_max_pooling1d_5 (Glob (None, 4)                 0         \n",
      "_________________________________________________________________\n",
      "dense_17 (Dense)             (None, 80)                400       \n",
      "_________________________________________________________________\n",
      "dense_18 (Dense)             (None, 1)                 81        \n",
      "=================================================================\n",
      "Total params: 2,385,485\n",
      "Trainable params: 2,385,485\n",
      "Non-trainable params: 0\n",
      "_________________________________________________________________\n"
     ]
    }
   ],
   "source": [
    "from imp import reload\n",
    "reload(cnn)\n",
    "\n",
    "voca_size = len(word2vocab)\n",
    "cnn_model = cnn.create_cnn(voca_size)\n",
    "cnn_model.compile(optimizer=tf.train.AdamOptimizer(),loss=\"binary_crossentropy\",metrics=[\"accuracy\"])\n",
    "cnn_model.summary()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(1953, 120)"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.shape"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 训练"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Train on 1757 samples, validate on 196 samples\n",
      "Epoch 1/30\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 2s 1ms/step - loss: 0.0044 - acc: 1.0000 - val_loss: 0.0042 - val_acc: 1.0000\n",
      "\n",
      "Epoch 2/30\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 2s 1ms/step - loss: 0.0040 - acc: 1.0000 - val_loss: 0.0038 - val_acc: 1.0000\n",
      "\n",
      "Epoch 3/30\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 2s 1ms/step - loss: 0.0037 - acc: 1.0000 - val_loss: 0.0035 - val_acc: 1.0000\n",
      "\n",
      "Epoch 4/30\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 2s 992us/step - loss: 0.0034 - acc: 1.0000 - val_loss: 0.0032 - val_acc: 1.0000\n",
      "\n",
      "Epoch 5/30\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 2s 998us/step - loss: 0.0031 - acc: 1.0000 - val_loss: 0.0030 - val_acc: 1.0000\n",
      "\n",
      "Epoch 6/30\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 2s 995us/step - loss: 0.0029 - acc: 1.0000 - val_loss: 0.0028 - val_acc: 1.0000\n",
      "\n",
      "Epoch 7/30\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 2s 1ms/step - loss: 0.0027 - acc: 1.0000 - val_loss: 0.0026 - val_acc: 1.0000\n",
      "\n",
      "Epoch 8/30\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 2s 1ms/step - loss: 0.0025 - acc: 1.0000 - val_loss: 0.0024 - val_acc: 1.0000\n",
      "\n",
      "Epoch 9/30\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 2s 1ms/step - loss: 0.0023 - acc: 1.0000 - val_loss: 0.0023 - val_acc: 1.0000\n",
      "\n",
      "Epoch 10/30\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 2s 1ms/step - loss: 0.0022 - acc: 1.0000 - val_loss: 0.0021 - val_acc: 1.0000\n",
      "\n",
      "Epoch 11/30\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 2s 995us/step - loss: 0.0021 - acc: 1.0000 - val_loss: 0.0020 - val_acc: 1.0000\n",
      "\n",
      "Epoch 12/30\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 2s 997us/step - loss: 0.0019 - acc: 1.0000 - val_loss: 0.0019 - val_acc: 1.0000\n",
      "\n",
      "Epoch 13/30\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 2s 995us/step - loss: 0.0018 - acc: 1.0000 - val_loss: 0.0018 - val_acc: 1.0000\n",
      "\n",
      "Epoch 14/30\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 2s 1ms/step - loss: 0.0017 - acc: 1.0000 - val_loss: 0.0017 - val_acc: 1.0000\n",
      "\n",
      "Epoch 15/30\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 2s 998us/step - loss: 0.0016 - acc: 1.0000 - val_loss: 0.0016 - val_acc: 1.0000\n",
      "\n",
      "Epoch 16/30\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 2s 994us/step - loss: 0.0015 - acc: 1.0000 - val_loss: 0.0015 - val_acc: 1.0000\n",
      "\n",
      "Epoch 17/30\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 2s 1ms/step - loss: 0.0015 - acc: 1.0000 - val_loss: 0.0014 - val_acc: 1.0000\n",
      "\n",
      "Epoch 18/30\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 2s 1ms/step - loss: 0.0014 - acc: 1.0000 - val_loss: 0.0013 - val_acc: 1.0000\n",
      "\n",
      "Epoch 19/30\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 2s 1ms/step - loss: 0.0013 - acc: 1.0000 - val_loss: 0.0013 - val_acc: 1.0000\n",
      "\n",
      "Epoch 20/30\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 2s 1ms/step - loss: 0.0012 - acc: 1.0000 - val_loss: 0.0012 - val_acc: 1.0000\n",
      "\n",
      "Epoch 21/30\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 2s 1ms/step - loss: 0.0012 - acc: 1.0000 - val_loss: 0.0012 - val_acc: 1.0000\n",
      "\n",
      "Epoch 22/30\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 2s 1ms/step - loss: 0.0011 - acc: 1.0000 - val_loss: 0.0011 - val_acc: 1.0000\n",
      "\n",
      "Epoch 23/30\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 2s 1ms/step - loss: 0.0011 - acc: 1.0000 - val_loss: 0.0011 - val_acc: 1.0000\n",
      "\n",
      "Epoch 24/30\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 2s 1ms/step - loss: 0.0010 - acc: 1.0000 - val_loss: 0.0010 - val_acc: 1.0000\n",
      "\n",
      "Epoch 25/30\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 2s 1ms/step - loss: 9.8992e-04 - acc: 1.0000 - val_loss: 9.6657e-04 - val_acc: 1.0000\n",
      "\n",
      "Epoch 26/30\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 2s 1ms/step - loss: 9.4789e-04 - acc: 1.0000 - val_loss: 9.2600e-04 - val_acc: 1.0000\n",
      "\n",
      "Epoch 27/30\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 2s 1ms/step - loss: 9.0847e-04 - acc: 1.0000 - val_loss: 8.8791e-04 - val_acc: 1.0000\n",
      "\n",
      "Epoch 28/30\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 2s 1ms/step - loss: 8.7143e-04 - acc: 1.0000 - val_loss: 8.5210e-04 - val_acc: 1.0000\n",
      "\n",
      "Epoch 29/30\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 2s 994us/step - loss: 8.3659e-04 - acc: 1.0000 - val_loss: 8.1839e-04 - val_acc: 1.0000\n",
      "\n",
      "Epoch 30/30\n",
      "1757/1757 [==============================]1757/1757 [==============================] - 2s 995us/step - loss: 8.0378e-04 - acc: 1.0000 - val_loss: 7.8663e-04 - val_acc: 1.0000\n",
      "\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<tensorflow.python.keras._impl.keras.callbacks.History at 0x17170710>"
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "batch = 128\n",
    "epoch = 30\n",
    "\n",
    "# pos转化为1，neg为0\n",
    "temp_label = list()\n",
    "for sub_label in label:\n",
    "    v = 1 if sub_label == \"pos\" else 0\n",
    "    temp_label.append(v)\n",
    "label = temp_label\n",
    "    \n",
    "cnn_model.fit(\n",
    "    x=data,a\n",
    "    y =label,\n",
    "    batch_size=batch,\n",
    "    epochs=epoch,\n",
    "    shuffle=True,\n",
    "    validation_split=0.1\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "celltoolbar": "Initialization Cell",
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.7"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {
    "height": "calc(100% - 180px)",
    "left": "10px",
    "top": "150px",
    "width": "244px"
   },
   "toc_section_display": true,
   "toc_window_display": true
  },
  "varInspector": {
   "cols": {
    "lenName": 16,
    "lenType": 16,
    "lenVar": 40
   },
   "kernels_config": {
    "python": {
     "delete_cmd_postfix": "",
     "delete_cmd_prefix": "del ",
     "library": "var_list.py",
     "varRefreshCmd": "print(var_dic_list())"
    },
    "r": {
     "delete_cmd_postfix": ") ",
     "delete_cmd_prefix": "rm(",
     "library": "var_list.r",
     "varRefreshCmd": "cat(var_dic_list()) "
    }
   },
   "types_to_exclude": [
    "module",
    "function",
    "builtin_function_or_method",
    "instance",
    "_Feature"
   ],
   "window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
